Skip to content

Add tax columns to orders and currency/test filter to payments#16

Open
pmbrull wants to merge 1 commit intomainfrom
feat/dbt-staging-enhancements
Open

Add tax columns to orders and currency/test filter to payments#16
pmbrull wants to merge 1 commit intomainfrom
feat/dbt-staging-enhancements

Conversation

@pmbrull
Copy link
Copy Markdown
Contributor

@pmbrull pmbrull commented Feb 25, 2026

Summary

  • stg_jaffle_shop__orders: Added tax_amount (estimated at 8% of order total) and gross_total (order_total + shipping + tax - discounts) columns
  • stg_stripe__payments: Added currency column (defaults to USD) and filters out test transactions (billing_email matching @test.com)
  • Updated _schema.yml with descriptions for the new columns

Impact

These staging model changes propagate downstream to:

  • int_orders__enriched (joins both staging models)
  • fct_orders (selects from enriched intermediate)
  • fct_daily_revenue / fct_monthly_revenue (aggregate from enriched orders)

Test plan

  • Run dbt build against demo database to validate SQL compiles
  • Verify tax_amount and gross_total calculations are correct
  • Confirm test transactions are filtered from payments
  • Check that downstream models still build successfully

🤖 Generated with Claude Code

- stg_jaffle_shop__orders: add tax_amount (8% of order_total) and
  gross_total (order_total + shipping + tax - discounts)
- stg_stripe__payments: add currency column (USD default) and filter
  out test transactions (billing_email @test.com)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Impact Analysis Report

Analyzing 2 changed model(s): stg_jaffle_shop__orders, stg_stripe__payments

============================================================

stg_jaffle_shop__orders

============================================================

What Changed

Two new columns, tax_amount and gross_total, were added to the stg_jaffle_shop__orders table. The tax_amount is calculated as 8% of the order_total, and the gross_total is the sum of order_total, shipping_cost, tax_amount, minus discount_amount.

Impact Summary

The modification affects multiple downstream tables in various schemas, which are used in business-critical dashboards and reports. This requires notifying several stakeholders to ensure integration accuracy and reliability.

Affected Assets

  1. Tables/Views:

  2. Dashboards:

    • default on Metabase, no specific owner indicated but affects multiple key charts for business intelligence and reporting.

Risk Assessment

  • Data Quality: Downstream tables utilizing the new tax_amount and gross_total columns must be tested to ensure calculations are accurate and consistent across reports.
  • Compliance: The additional financial calculations might have regulatory impacts if used for financial reporting.
  • Business Impact: Key surveillance dashboards and financial reporting might display incorrect data if not updated to incorporate changes correctly.

Recommended Actions

  1. Notify Stakeholders:

    • Alice Johnson (Data Engineering)
    • Eve Davis (Product Analyst)
    • Bob Smith (Finance Analyst)
  2. Update Downstream Assets:

  3. Considerations:

    • Ensure any reporting using gross_total includes this in their financial summaries for correct gross calculations.
    • Validate all downstream calculations during the next reporting cycle.

============================================================

stg_stripe__payments

============================================================

What Changed

The stg_stripe__payments model has been updated to include a new column 'USD' as currency, and a filter was added to exclude transactions where billing_email ends with @test.com.

Impact Summary

The changes primarily affect downstream models and dashboards that rely on the stg_stripe__payments model for payment details. Adding the currency column could impact calculations or aggregations in downstream processes. The new filter will exclude test transactions from downstream analysis, potentially affecting insights based on transaction volume or value.

Affected Assets

  1. int_orders__enriched
    • Owner: Alice Johnson
  2. dim_customers
    • Owner: Eve Davis
  3. fct_orders
    • Owner: Eve Davis
  4. default Dashboard
    • Charts: Multiple charts impacted, no specific owner assigned.
  5. fct_daily_revenue
    • Owner: Bob Smith

Risk Assessment

  • Data Quality: Potential for misalignment in currency-related calculations; test transactions will no longer be included, possibly altering expected data tests.
  • Compliance: Introducing a hardcoded currency may simplify currency handling but could lead to issues if multi-currency support is needed in the future.
  • Business: Any dashboard or report relying on full transaction datasets might show decreased figures or volumes suddenly, impacting business intelligence outputs.

Recommended Actions

  1. Notify Stakeholders:

    • Alice Johnson
    • Eve Davis
    • Bob Smith
  2. Update These Assets:

  3. Consider Alternatives:

    • Explore dynamic currency columns or configurations for multi-currency support.
    • Develop a flag for test transactions instead of removing them, maintaining comprehensive logging.

============================================================

Summary

============================================================

Model Status
stg_jaffle_shop__orders Done
stg_stripe__payments Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant